package com.ruoyi.parcel.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.parcel.service.IEAdvertisementsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.parcel.mapper.EAdvertisementsMapper;
import com.ruoyi.parcel.domain.EAdvertisements;
import com.ruoyi.parcel.service.IEAdvertisementsService;

/**
 * parcelService业务层处理
 *
 * @author ruoyi
 * @date 2024-11-28
 */
@Service
public class EAdvertisementsServiceImpl implements IEAdvertisementsService
{
    @Autowired
    private EAdvertisementsMapper eAdvertisementsMapper;

    /**
     * 查询parcel
     *
     * @param id parcel主键
     * @return parcel
     */
    @Override
    public EAdvertisements selectEAdvertisementsById(Long id)
    {
        return eAdvertisementsMapper.selectEAdvertisementsById(id);
    }

    /**
     * 查询parcel列表
     *
     * @param eAdvertisements parcel
     * @return parcel
     */
    @Override
    public List<EAdvertisements> selectEAdvertisementsList(EAdvertisements eAdvertisements)
    {
        return eAdvertisementsMapper.selectEAdvertisementsList(eAdvertisements);
    }

    /**
     * 新增parcel
     *
     * @param eAdvertisements parcel
     * @return 结果
     */
    @Override
    public int insertEAdvertisements(EAdvertisements eAdvertisements)
    {
        eAdvertisements.setCreateTime(DateUtils.getNowDate());
        return eAdvertisementsMapper.insertEAdvertisements(eAdvertisements);
    }

    /**
     * 修改parcel
     *
     * @param eAdvertisements parcel
     * @return 结果
     */
    @Override
    public int updateEAdvertisements(EAdvertisements eAdvertisements)
    {
        return eAdvertisementsMapper.updateEAdvertisements(eAdvertisements);
    }

    /**
     * 批量删除parcel
     *
     * @param ids 需要删除的parcel主键
     * @return 结果
     */
    @Override
    public int deleteEAdvertisementsByIds(Long[] ids)
    {
        return eAdvertisementsMapper.deleteEAdvertisementsByIds(ids);
    }

    /**
     * 删除parcel信息
     *
     * @param id parcel主键
     * @return 结果
     */
    @Override
    public int deleteEAdvertisementsById(Long id)
    {
        return eAdvertisementsMapper.deleteEAdvertisementsById(id);
    }

    @Override
    public void updateStatus(Long id) {
        eAdvertisementsMapper.updateStatus(id);
    }
}
